package com.guanyong.dao;

import com.guanyong.model.CommentModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Created by mxk on 2017/6/3.
 */
public interface ICommentDaoMapper {
    int insert(@Param(value = "record") CommentModel record);

    int update(@Param(value = "record") CommentModel record);

    @Update("UPDATE t_ad_comment SET f_goodct=f_goodct+1 WHERE f_id=#{id}")
    int UpdateGoodCt(int fid);

    @Update("UPDATE t_ad_comment SET f_reportct=f_reportct+1 WHERE f_id=#{id}")
    int UpdateReportct(int fid);


    @Update("update t_ad_comment set f_show=#{state} where f_parentid=#{parentid}")
    Integer UpdateParentState(
                              @Param("state")Integer state,
                              @Param("parentid")Integer parentid);




    List<CommentModel> SelectCommentList(@Param("commentModel") CommentModel commentModel,
                                         @Param("offset")Integer offset,
                                         @Param("limit") Integer limit);
    Integer SelectCommentListCount(@Param("commentModel") CommentModel commentModel);
}
